﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
   public class NewsObj
    {
        private string _NewsID;

        public string NewsID
        {
            get { return _NewsID; }
            set { _NewsID = value; }
        }
        private string _Name;

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        private string _Order;

        public string Order
        {
            get { return _Order; }
            set { _Order = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }
        private string _Description;

        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        private string _Overview;

        public string Overview
        {
            get { return _Overview; }
            set { _Overview = value; }
        }
        private string _Detail;

        public string Detail
        {
            get { return _Detail; }
            set { _Detail = value; }
        }
       
        private string _Date;

        public string Date
        {
            get { return _Date; }
            set { _Date = value; }
        }
        private string _Index;

        public string Index
        {
            get { return _Index; }
            set { _Index = value; }
        }
        private string _View;

        public string View
        {
            get { return _View; }
            set { _View = value; }
        }
        private string _Keyword;

        public string Keyword
        {
            get { return _Keyword; }
            set { _Keyword = value; }
        }
        private string _Title;

        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        public NewsObj SetValuesFromDataReader(IDataReader reader)
        {
            NewsObj obj = new NewsObj();
            obj.NewsID = (reader["NewsID"] is DBNull) ? String.Empty : reader["NewsID"].ToString();
            obj.Name = (reader["Name"] is DBNull) ? String.Empty : reader["Name"].ToString();
            obj.Order = (reader["Order"] is DBNull) ? "0" : reader["Order"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            obj.Description = (reader["Description"] is DBNull) ? String.Empty : reader["Description"].ToString();
            obj.Overview = (reader["Overview"] is DBNull) ? String.Empty : reader["Overview"].ToString();
            obj.Detail = (reader["Detail"] is DBNull) ? String.Empty : reader["Detail"].ToString();
            obj.Date = (reader["Date"] is DBNull) ? String.Empty : reader["Date"].ToString();
            obj.Index = (reader["Index"] is DBNull) ? String.Empty : reader["Index"].ToString();
            obj.View = (reader["View"] is DBNull) ? "0" : reader["View"].ToString();
            obj.Keyword = (reader["Keyword"] is DBNull) ? String.Empty : reader["Keyword"].ToString();
            obj.Title = (reader["Title"] is DBNull) ? String.Empty : reader["Title"].ToString();
            return obj;
        }
    }
}
